﻿@model IEnumerable<WebChat.Models.Message>
@{
    ViewBag.Title = "Meldinger";
}
<h2>
    Meldinger</h2>
<table>
    <tr>
        <th>
            Forfatter
        </th>
        <th>
            Dato
        </th>
        <th>
            Chatroom
        </th>
        <th>
            Melding
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Date)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Chatroom)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Message1)
            </td>
            <td>
                @Html.ActionLink("Detaljer", "DetailsMessages", new { id = item.Id }) |
                @Html.ActionLink("Slett", "DeleteRoomMessages", new { id = item.Id, chatId = item.Chatroom })
            </td>
        </tr>
    }
</table>
<div>
    @Html.ActionLink("Tilbake", "Index")
</div>
